﻿<%@ Page Title="" Language="C#" MasterPageFile="~/NovaSystem.Master" AutoEventWireup="true" CodeBehind="wfProveedorFactura.aspx.cs" Inherits="NovaSystem.InterfazUsuarioWeb.Contabilidad.wfProveedorFactura" %>
<%@ Register assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" namespace="System.Web.UI" tagprefix="asp" %>
<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="cc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <table cellpadding="0" cellspacing="0" border="0" class="tabla" width="760px" align="center">
<tr>
<td>
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <cc1:CalendarExtender ID="ceFechaFactura" runat="server" FirstDayOfWeek="Monday" Format="dd/MM/yyyy" PopupButtonID="btnFechaFactura" PopupPosition="BottomLeft" TargetControlID="txtFechaFactura" >
    </cc1:CalendarExtender>
    <br />
    <table>
    <tr>
    <td>Nº Factura</td>
    <td><asp:TextBox runat="server" ID="txtNumeroFactura" Width="90px"></asp:TextBox>
        <asp:RequiredFieldValidator ID="rfvFactura" runat="server" 
            ControlToValidate="txtNumeroFactura" ErrorMessage="Ingrese Numero Factura" 
            ValidationGroup="Grabar">*</asp:RequiredFieldValidator>
        </td>
    <td></td>
    <td>
        <asp:HiddenField ID="hfIdProveedor" runat="server" />
        </td>
    <td></td>
    <td><asp:DropDownList runat="server" ID="ddlAfectaExcenta">
        <asp:ListItem Value="AFECTA">AFECTA</asp:ListItem>
        <asp:ListItem>EXENTA</asp:ListItem>
        </asp:DropDownList></td>
    <td></td>
    <td>Tipo Cambio</td>
    <td><asp:TextBox runat="server" ID="txtTipoCambio" Width="68px" 
            CssClass="textBoxNumerico">0</asp:TextBox></td>
    </tr>
    <tr>
    <td>Proveedor</td>
    <td><asp:TextBox runat="server" ID="txtRutProveedor" Width="89px"></asp:TextBox></td>
    <td><asp:ImageButton runat="server" ID="btnBuscarProveedor" ImageUrl="~/img/Find.png" /></td>
    <td><asp:TextBox runat="server" ID="txtNombreProveedor" Width="193px"></asp:TextBox>
        <asp:RequiredFieldValidator ID="rfvProveedor" runat="server" 
            ControlToValidate="txtNombreProveedor" ErrorMessage="Ingrese Proveedor" 
            ValidationGroup="Grabar">*</asp:RequiredFieldValidator>
        </td>
    <td>F. Factura</td>
    <td><asp:TextBox runat="server" ID="txtFechaFactura" Width="81px" 
            style="text-align:center"></asp:TextBox></td>
    <td><asp:ImageButton runat="server" ID="btnFechaFactura"  
            ImageUrl="~/img/Calendar.png" /></td>
    <td>O. Compra</td>
    <td><asp:TextBox runat="server" ID="txtOrdenCompra" Width="69px"></asp:TextBox></td>
    </tr>
    <tr>
    <td>Direccion</td>
    <td colspan="3">
        <asp:TextBox runat="server" ID="txtDireccionProveedor" 
            Width="314px"></asp:TextBox>
        <asp:RequiredFieldValidator ID="rfvDireccion" runat="server" 
            ControlToValidate="txtDireccionProveedor" 
            ErrorMessage="Ingrese Direccion Proveedor" ValidationGroup="Grabar">*</asp:RequiredFieldValidator>
        </td>
    <td>Paìs</td>
    <td colspan="2"><asp:DropDownList runat="server" id="ddlPais" 
            DataTextField="descripcion" DataValueField="codigo"></asp:DropDownList>
        <asp:RequiredFieldValidator ID="rfvPais" runat="server" 
            ControlToValidate="ddlPais" ErrorMessage="Ingrese Pais Proveedor" 
            ValidationGroup="Grabar">*</asp:RequiredFieldValidator>
        </td>
    <td>Moneda</td>
    <td><asp:DropDownList runat="server" ID="ddlMoneda" DataTextField="codigo" 
            DataValueField="codigo"></asp:DropDownList></td>
    </tr>
    
    </table>
</td>
</tr>
<tr>
<td background="../img/separador.png">
    <asp:TextBox ID="TextBox1" runat="server" Height="23px" Width="16px" 
        style="visibility:hidden"></asp:TextBox>
    </td>
</tr>
</table>

<table cellpadding="0" cellspacing="0" border="0" class="tabla" width="760px" align="center">
<tr>
<td background="../img/separadormenu.png" class="tituloTabla">Detalle
    <asp:TextBox ID="txtSeparadorDet" runat="server" Height="16px" Width="16px" 
        style="visibility:hidden"></asp:TextBox>
    </td>
</tr>
<tr>
<td>
        <table>
        <tr>
        <td colspan="2">Producto</td>
        <td>Descripción</td>
        <td>Cantidad</td>
        <td>Precio </td>
        <td>Total</td>
        
        </tr>
        <tr>
        <td><asp:TextBox runat="server" ID="txtProducto" Width="100px"></asp:TextBox>
            <asp:HiddenField ID="hfIdProducto" runat="server" />
            <asp:RequiredFieldValidator ID="rfvProducto" runat="server" 
                ControlToValidate="txtProducto" ErrorMessage="Ingrese Codigo Producto" 
                ValidationGroup="Agregar">*</asp:RequiredFieldValidator>
            </td>
        <td><asp:ImageButton runat="server" ID="btnBuscarProducto" ImageUrl="~/img/Find.png" /></td>
        <td><asp:TextBox runat="server" ID="txtDescripcion" Width="180px"></asp:TextBox>
            <asp:RequiredFieldValidator ID="rfvDescripcion" runat="server" 
                ControlToValidate="txtDescripcion" ErrorMessage="Ingrese Descripción Producto" 
                ValidationGroup="Agregar">*</asp:RequiredFieldValidator>
            </td>
        <td><asp:TextBox runat="server" ID="txtCantidad" Width="43px"></asp:TextBox>
            <asp:RequiredFieldValidator ID="rfvCantidad" runat="server" 
                ControlToValidate="txtCantidad" ErrorMessage="Ingrese Cantidad" 
                ValidationGroup="Agregar">*</asp:RequiredFieldValidator>
            <asp:RangeValidator ID="rvCantidad" runat="server" 
                ControlToValidate="txtCantidad" ErrorMessage="Cantidad No valida" 
                MaximumValue="999999999" MinimumValue="1" Type="Integer" 
                ValidationGroup="Agregar">*</asp:RangeValidator>
            </td>
        <td><asp:TextBox runat="server" ID="txtPrecio" Width="55px" 
                CssClass="textBoxNumerico"></asp:TextBox>
            <asp:RequiredFieldValidator ID="rfvPrecio" runat="server" 
                ControlToValidate="txtPrecio" ErrorMessage="Ingrese Precio" 
                ValidationGroup="Agregar">*</asp:RequiredFieldValidator>
            <asp:RangeValidator ID="rvPrecio" runat="server" ControlToValidate="txtPrecio" 
                ErrorMessage="Precio No valida" MaximumValue="999999999" 
                MinimumValue="0,000001" Type="Double" ValidationGroup="Agregar">*</asp:RangeValidator>
            </td>
        <td><asp:TextBox runat="server" ID="txtTotal" ReadOnly="true" Width="74px" 
                CssClass="textBoxNumerico"></asp:TextBox></td>
        <td><asp:Button runat="server" ID="btnAgregar" Text="Agregar" Width="58px" 
                onclick="btnAgregar_Click" ValidationGroup="Agregar" /></td>
        </tr>
        <tr>
            <td colspan="7">
       
                <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                  <ContentTemplate>
                <div id="divDetalleHeader" style="display:none">
                <table class="mGrid">
                <tr>
                <th>Producto</th>
                <th>Descripcion</th>
                <th>Cantidad</th>
                <th>Precio</th>
                <th>Unidad</th>
                <th>Total</th>
                <th>Precio Unit.</th>
                </tr>
                <tr>
                <td align="center" colspan="7">No existen registros en el detalle</td>
                </tr>
                </table>
                </div>
                <asp:GridView runat="server" ID="gvDetalle" CssClass="mGrid" Width="738px" 
                          onrowcreated="gvDetalle_RowCreated">
                    <Columns>
                        <asp:TemplateField>
                            <ItemTemplate>
                                <asp:ImageButton ID="btnDelete" runat="server" ImageUrl="~/img/Delete.png" OnCommand="OnDelete" CommandArgument="<%# Container.DataItemIndex %>" />
                            </ItemTemplate>
                            <ItemStyle Width="20px" />
                        </asp:TemplateField>
                    </Columns>
                      </asp:GridView>
            </ContentTemplate>
                </asp:UpdatePanel>
            </td>
            
        </tr>
        <tr>
        <td colspan="4">Observaciones</td>
        <td>Subtotal</td>
        <td><asp:TextBox runat="server" ID="txtSubTotal" Width="93px" 
                CssClass="textBoxNumerico" Enabled="False"></asp:TextBox></td>
        </tr>
        <tr>
        <td colspan="4" rowspan="2">
            <asp:TextBox runat="server" ID="txtObservacion" 
                Width="491px" Height="46px" TextMode="MultiLine"></asp:TextBox></td>
        <td>Impuesto</td>
        <td><asp:TextBox runat="server" ID="txtIva" Width="93px" CssClass="textBoxNumerico" 
                Enabled="False"></asp:TextBox></td>
        </tr>
        <tr>
        <td>Descuento</td>
        <td><asp:TextBox runat="server" ID="txtDescuento" Width="93px" 
                CssClass="textBoxNumerico"></asp:TextBox></td>
        </tr>
        
        <tr>
        <td colspan="4"></td>
        <td>Total</td>
        <td><asp:TextBox runat="server" ID="txtTotalGeneral" Width="93px" 
                CssClass="textBoxNumerico"></asp:TextBox></td>
        </tr>
        <tr>
        <td colspan="10" align="center"><asp:Button runat="server" ID="btnGrabar" 
                Text="Grabar" onclick="btnGrabar_Click" ValidationGroup="Grabar" /> 
            &nbsp;&nbsp; 
            <asp:Button runat="server" ID="btnLimpiar" Text="Limpiar" />
        </td>
        </tr>
        </table>


</td>
</tr>
<tr>
<td background="../img/separador.png">
    <asp:TextBox ID="TextBox2" runat="server" Height="23px" Width="16px" 
        style="visibility:hidden"></asp:TextBox>
    </td>
</tr>
</table>


</asp:Content>
